package com.yycx.module.bus.provider.controller.hy;

import com.yycx.common.base.entity.EntityMap;
import com.yycx.common.mybatis.model.ResultBody;
import com.yycx.module.bus.provider.service.hy.HyRemoteOrderService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;


/**
 * 入订单主控制器(采购数据)
 *
 * @author flyme
 * @date 2020-11-28
 */
@RestController
@RequestMapping("/hy/remote/order/")
public class HyRemoteOrderController {

    @Autowired
    private HyRemoteOrderService hyRemoteOrderService;

    @ApiOperation(value = "非两票订单订单-分页列表", notes = "非两票订单订单分页列表")
    @GetMapping(value = "page")
    public ResultBody pageList(@RequestParam(required = false) Map params) {
        return hyRemoteOrderService.hyOrderList(params);
    }


    @ApiOperation(value = "非两票订单订单-详情", notes = "非两票订单订单详情")
    @GetMapping(value = "get")
    public ResultBody get(@RequestParam String orderNo) {
        EntityMap result = hyRemoteOrderService.getHyOrderById(orderNo);
        return ResultBody.ok(result);
    }

    @ApiOperation(value = "海鹰订单-列表", notes = "海鹰订单列表")
    @GetMapping(value = "queryHyOrderDetailList")
    public ResultBody queryHyOrderDetailList(String orderNo) {
        List<EntityMap> list = hyRemoteOrderService.queryHyOrderDetailList(orderNo);
        return ResultBody.ok(list);
    }


    @ApiOperation(value = "库存明细-分页列表", notes = "库存明细")
    @GetMapping(value = "stockReport")
    public ResultBody stockReport(@RequestParam(required = false) Map params) {
        return hyRemoteOrderService.stockReport(params);
    }
}
